'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
    return queryInterface.sequelize.transaction(async t => {
      await queryInterface.bulkInsert("sys_config", [
        {
          config_id:1,
          config_name:"主框架页-默认皮肤样式名称",
          config_key:"sys.index.skinName",
          config_value:"skin-blue",
          config_type:"Y",
          create_by:"admin",
          update_by:"admin",
          remark:"蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow",
          created_at: new Date(),
          updated_at: new Date()
        },{
          config_id:2,
          config_name:"用户管理-账号初始密码",
          config_key:"sys.user.initPassword",
          config_value:"123456",
          config_type:"Y",
          create_by:"admin",
          update_by:"admin",
          remark:"初始化密码 123456",
          created_at: new Date(),
          updated_at: new Date()
        },{
          config_id:3,
          config_name:"主框架页-侧边栏主题",
          config_key:"sys.index.sideTheme",
          config_value:"theme-dark",
          config_type:"Y",
          create_by:"admin",
          update_by:"admin",
          remark:"深色主题theme-dark，浅色主题theme-light",
          created_at: new Date(),
          updated_at: new Date()
        }
      ], { transaction: t });
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
    return queryInterface.sequelize.transaction(async t => {
      return await queryInterface.bulkDelete("sys_config", null, { transaction: t });
    })
  }
};
